package quickConnect;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.WindowConstants;

import org.quickconnect.ControlObject;
import org.quickconnect.QuickConnect;

import beans.SessionBean;

import userInterface.ChatSessionPanel;
import userInterface.MainFrame;
import userInterface.StandardTableModel;

public class RemoveFromUsersListVCO implements ControlObject {
		@Override
		public Object handleIt(ArrayList<Object> arg0) {
			
			HashMap params = (HashMap) arg0.get(0);
			String id = (String) params.get("sessionId");
			String[] user = (String[]) params.get("user");

			ArrayList<ChatSessionPanel> sessions = MainFrame.mainFrame.getChatSessions();
			for(int i = 0; i < sessions.size(); i++){
				SessionBean curSession = sessions.get(i).getSession();
				if(curSession.getSessionId().equals(id)){
					sessions.get(i).getaUserPanel().removeUser(user);
					break;
				}
			}
			return null;
		}

}
